import React from "react";
import "./index.less";
import { TRoomBar } from "./type";
import { COMURL } from "../../constant";
const RoomBar: React.FC<TRoomBar> = ({
  roomName,
  roomIntroduce,
  roomPhoto,
  onClickRoom,
  id,
}) => {
  return (
    <div className="room-ctn" onClick={() => onClickRoom?.(roomName, id)}>
      <div className="room-img-ctn">
        <img src={`${COMURL}${roomPhoto}`} alt="" className="" />
      </div>
      <div className="des">
        <h2 className="title">{roomName}</h2>
        <div className="txt">{roomIntroduce}</div>
      </div>
    </div>
  );
};
export default RoomBar;
